//创建一个路由器，并暴露出去

//第一步：引入createRouter
import { createRouter, createWebHistory } from 'vue-router';
//引入一个个可能呈现的组件
import Home from "../pages/Home.vue";
import News from "../pages/News.vue";
import About from "../pages/About.vue";
import Contact from "../pages/Detail.vue";
import Detail from '../pages/Detail.vue';
//第二步：创建路由器
const router = createRouter({
        history:createWebHistory(),//路由器的工作模式
    routes:[//一个个的路由规则
        {
            path:'/home',
            component:Home
        },
        {
            path:'/news',
            component:News,
            children:[
                {
                    path:'detail',
                    component:Detail
                }
            ]
        },
        {
            path:'/about',
            component:About
        }
    ]
})

export default router;